home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14001 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: gail.ripco.com!mambuhl
  3. From: mambuhl@ripco.com (Martin Ambuhl)
  4. Subject: Re: making #define`s to b
  5. Message-ID: <DpotxC.6LI@rci.ripco.com>
  6. X-Nntp-Sender: mambuhl@cook.ripco.com
  7. Sender: usenet@rci.ripco.com (Net News Admin)
  8. Organization: Ripco Internet BBS Chicago
  9. Date: Thu, 11 Apr 1996 07:53:36 GMT
  10.  
  11. dheffel@vitds2.nswc.navy.mil (David R. Heffelfinger) in
  12. <1996Apr9.164443.28709@relay.nswc.navy.mil> asks:
  13.  
  14. >Hi there,
  15. >    There is (hopefully) a simple answer to my question:
  16.  
  17. >I have some C code divided into different source files.
  18. >When I try to compile using
  19. >  "cc file1.c file2.c file3.c"
  20. >the constants #define'd in file1.c are not visible in file2.c, is there a way t
  21. > make them visible to the other source files?  In other words, is there som equ
  22. >valent to "extern" for constants?
  23.  
  24. move the #defined constants to a header file (say `files.h'), and in
  25. each of the file?.c
  26.         #include "files.h"
  27.  
  28.                               
  29. --
  30. * Martin Ambuhl       net: mambuhl@ripco.com
  31. * Chicago, IL (USA)    
  32.